home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 2: CDPD 1 / Almathera Ten on Ten - Disc 2: CDPD 1.iso / pd / 076-100 / 085 / csh / shell.h < prev    next >
C/C++ Source or Header  |  1995-03-13  |  4KB  |  122 lines

  1.  
  2. /*
  3.  * SHELL.H
  4.  *
  5.  * (c)1986 Matthew Dillon     9 October 1986
  6.  *
  7.  *
  8.  * SHELL include file.. contains shell parameters and extern's
  9.  *
  10.  * version 2.06M (Manx Version and Additions) by Steve Drew 28-May-87
  11.  *
  12.  */
  13.  
  14. #include <stdio.h>
  15. #include <time.h>
  16. #include <exec/types.h>
  17. #include <exec/exec.h>
  18. #include <libraries/dos.h>
  19. #include <libraries/dosextens.h>
  20. #include <exec/memory.h>
  21. #include <exec/tasks.h>
  22. #include <exec/ports.h>
  23. #include <exec/io.h>
  24. #include <functions.h>
  25. #include <fcntl.h>
  26.  
  27. #define bmov   movmem
  28. #define STDBUF 1
  29.  
  30. #define MAXAV         256        /* Max. # arguments            */
  31. #define MAXSRC         5            /* Max. # of source file levels */
  32. #define MAXIF         10            /* Max. # of if levels        */
  33. #define MAXALIAS     20            /* Max. # of alias levels        */
  34.  
  35. #define LEVEL_SET    0            /* which variable list to use   */
  36. #define LEVEL_ALIAS  1
  37. #define LEVEL_LABEL  2
  38.  
  39. #define V_PROMPT     "_prompt"        /* your prompt (ascii command)   */
  40. #define V_HIST         "_history"        /* set history depth (value)     */
  41. #define V_HISTNUM    "_histnum"        /* set history numbering var     */
  42. #define V_DEBUG         "_debug"        /* set debug mode             */
  43. #define V_VERBOSE    "_verbose"        /* set verbose for source files  */
  44. #define V_STAT         "_maxerr"        /* worst return value to date    */
  45. #define V_LASTERR    "_lasterr"        /* return value from last comm.  */
  46. #define V_CWD         "_cwd"        /* current directory         */
  47. #define V_EXCEPT     "_except"        /* "nnn;command"             */
  48. #define V_PASSED     "_passed"        /* passed arguments to source fle*/
  49. #define V_PATH         "_path"        /* search path for external cmds */
  50.  
  51.         /* EXECOM.C defines */
  52.  
  53. #define FL_DOLLAR    0x01  /* One of the following */
  54. #define FL_BANG         0x02
  55. #define FL_PERCENT   0x04
  56. #define FL_QUOTE     0x08
  57. #define FL_IDOLLAR   0x10  /* Any or all of the following may be set */
  58. #define FL_EOC         0x20
  59. #define FL_EOL         0x40
  60. #define FL_OVERIDE   0x80
  61. #define FL_WILD         0x100
  62. #define FL_MASK         (FL_DOLLAR|FL_BANG|FL_PERCENT|FL_QUOTE)
  63.  
  64.  
  65. #define VERSION      "V2.06M  (c)1986 Matthew Dillon.  Manx version by Steve Drew"
  66.  
  67. #ifndef NULL
  68. #define NULL 0L
  69. #endif
  70.  
  71. #define CHECKBREAK() ( breakcheck() ? (printf("^C\n"),1) : 0)
  72.  
  73. #ifndef AZTEC_C
  74. struct _dev     {
  75.         long  fd;
  76.         short mode;
  77.     };
  78. #endif
  79.  
  80. struct HIST {
  81.    struct HIST *next, *prev;     /* doubly linked list */
  82.    char *line;             /* line in history    */
  83. };
  84.  
  85. struct PERROR {
  86.    int errnum;             /* Format of global error lookup */
  87.    char *errstr;
  88. };
  89.  
  90. struct DPTR {             /* Format of directory fetch pointer */
  91.    struct FileLock *lock;     /* lock on directory    */
  92.    struct FileInfoBlock *fib;     /* mod'd fib for entry */
  93. };
  94.  
  95. extern struct HIST *H_head, *H_tail;
  96. extern struct PERROR Perror[];
  97. extern struct DPTR *dopen();
  98. extern char *set_var(), *get_var(), *next_word();
  99. extern char *get_history(), *compile_av();
  100. extern char *malloc(), *strcpy(), *strcat();
  101. extern char **expand();
  102. extern char *av[];
  103. extern char *Current;
  104. extern int  H_len, H_tail_base, H_stack;
  105. extern int  E_stack;
  106. extern int  Src_stack, If_stack;
  107. extern int  ac;
  108. extern int  debug, Rval, Verbose, disable, Quit;
  109. extern int  Lastresult;
  110. extern int  Exec_abortline, Exec_ignoreresult;
  111. extern int   S_histlen;
  112. extern long  Uniq;
  113. extern long  Cin, Cout, Cout_append;
  114. extern char *Cin_name, *Cout_name;
  115. extern char  Cin_type,    Cout_type;  /* these variables are in transition */
  116. extern char *Pipe1, *Pipe2;
  117.  
  118. extern long Src_base[MAXSRC];
  119. extern long Src_pos[MAXSRC];
  120. extern char If_base[MAXIF];
  121. extern struct Process *Myprocess;
  122.